package com.cars.easyEs.common.exception;

import lombok.Getter;

/**
 * @author caoqianfan
 * @date 2024/2/26 16:12
 */
@Getter
public class EsException extends RuntimeException {
    private final Integer code;
    private final String msg;

    public EsException(ResponseCodeEnums codeEnums) {
        super(codeEnums.getMessage());
        this.code = codeEnums.getCode();
        this.msg = codeEnums.getMessage();
    }

    public EsException(Integer code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }
}
